Chinese Remainder Theorem

The Chinese remainder theorem is a statement about existence of solutions to a system of linear congruences. The problem originates from the book third century book Sun-tzu Suan-ching:

There are certain things whose number is unknown. If we count them by threes, we have two left over; by fives, we have three left over; and by sevens, two are left over. How many things are there?

The theorem is as follows:

Theorem

Given moduli m1,m2,,mn which are pairwise coprime integers, and a1,a2,,anZ, there is a unique solution modulo m=m1m2mn to the system of equations:

xa1(modm1)xa2(modm2)xan(modmn)

Note that the proof given below is non-constructive. For actually finding such a solution, see the chinese remainder theorem algorithm.


The core part of the result that needs to be proven is the following isomorphism of additive groups:

Z/nZ=Z/sZZ/tZ

if gcd(s,t)=1.

The full result then follows by induction.

This is equivalent to the decomposition of cyclic groups. It is proven here again to show the explicit isomorphism from Z/nZ to Z/sZZ/tZ, however the proof is otherwise identical, and is only repeated for convenience.

Note that this method does not give an explicit way to invert this isomorphism (that is what the chinese remainder theorem algorithm) is for.

Proof

Consider the homomorphism

ϕ:Z/nZZ/sZZ/tZ

given by

ϕ:a+nZ(a+sZ,a+tZ).

We will prove that this is an isomorphism simply by showing that the kernel is just the identity.

ker(ϕ)={a+nZZ/nZ:ϕ(a+nZ)=(0+sZ,0+tZ)}={a+nZZ/nZ:(a+sZ,a+tZ)=(0+sZ,0+tZ)}={a+nZZ/nZ:a+sZ=0+sZanda+tZ=0+tZ}={a+nZZ/nZ:asZandatZ}={a+nZZ/nZ:saandta}(1)={a+nZZ/nZ:sta}={a+nZZ/nZ:na}={0+nZ}

where step (1) is where the coprimality condition is used.